﻿using Magicodes.ExporterAndImporter.Core;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace NP.BPMReportPlatform.AnalysisInstance.Dtos
{
    /// <summary>
    /// 分析实例结果
    /// </summary>
    public class AnalysisInstanceResultDto
    {
        /// <summary>
        /// 流程名称
        /// </summary>
        [ExporterHeader("流程名称")]
        public string ProcessName { get; set; }

        /// <summary>
        /// 实例编码
        /// </summary>
        [JsonIgnore]
        public int InstanceId { get; set; }

        /// <summary>
        /// 实例编码
        /// </summary>
        [ExporterHeader("流程单号")]
        public string InstanceNumber { get; set; }

        /// <summary>
        /// 实例主题
        /// </summary>
        [ExporterHeader("流程主题")]
        public string InstanceTopic { get; set; }

        /// <summary>
        /// 实例状态
        /// </summary>
        public int? InstanceStatus { get; set; }

        /// <summary>
        /// 实例状态
        /// </summary>
        [ExporterHeader("审批状态")]
        public string InstanceStatusName { get; set; }

        /// <summary>
        /// 实例人员名称
        /// </summary>
        [ExporterHeader("建单人")]
        public string InstanceUserName { get; set; }

        /// <summary>
        /// 实例提交时间
        /// </summary>
        [ExporterHeader("提交时间")]
        public DateTime? InstanceStartTime { get; set; }

        /// <summary>
        /// 实例结束时间
        /// </summary>
        [ExporterHeader("审批完成日期")]
        public DateTime? InstanceEndTime { get; set; }

        /// <summary>
        /// 节点量
        /// </summary>
        public int NodeCount { get; set; }

        /// <summary>
        /// 流程审批时长
        /// </summary>
        [ExporterHeader("审批用时(小时)")]
        public double? ElapsedTime { get; set; }

        /// <summary>
        /// 当前审批节点
        /// </summary>
        [ExporterHeader("当前审批节点")]
        public string CurrentNode { get; set; }

        /// <summary>
        /// 当前审批人
        /// </summary>
        [ExporterHeader("当前审批人")]
        public string CurrentApprover { get; set; }


        #region ActivitieTaskModel

        public string Name { get; set; }

        public DateTime ArriveTime { get; set; }

        public int ActivityElapsedTime { get; set; }

        public DateTime FinishTime { get; set; }

        public string UserName { get; set; }

        public string GrandNodeId { get; set; }

        public int Order { get; set; }

        public Guid ActivityId { get; set; }

        public int? Status { get; set; }

        [ExporterHeader(IsIgnore = true)]
        public string Url { get; set; }

        #endregion
    }

    public class ActivitieTaskModel
    {
        public int InstanceId { get; set; }

        public string InstanceNumber { get; set; }

        public string Name { get; set; }

        public DateTime ArriveTime { get; set; }

        public int ElapsedTime { get; set; }

        public DateTime FinishTime { get; set; }

        public int Order { get; set; }

        public string UserId { get; set; }

        public string UserName { get; set; }

        public string GrandNodeId { get; set; }

        public Guid ActivityId { get; set; }

        public int? Status { get; set; }
    }
}
